home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / U. Mass AI & LISP Tools / About Dan's Tools
Encoding:
Text File  |  1990-06-24  |  14.8 KB  |  339 lines  |  [TEXT/CCL ]

  1. ;--------------------------------------------------------------------------
  2. ; (c) Copyright 1990 by University of Massachusetts. All rights reserved.
  3. ;
  4. ; This software was conceived, designed, and written by Dan Suthers 
  5. ; while supported by the National Science Foundation under grant number
  6. ; MDR 8751362, and by a fellowship from Apple Computer, Inc., Cupertino,
  7. ; CA.  Partial support was also received from the Office of Naval Research
  8. ; under a University Research Initiative Grant, contract N00014-86-K-0764.
  9. ; Mr. Suthers created this software under his own initiative while in an 
  10. ; academic relationship with the University of Massachusetts.  The above
  11. ; copyright notice was a condition placed by University lawyers on approval
  12. ; of distribution of this software by Apple Computer, and is not meant to
  13. ; imply that this software was created in an employment or "work for hire"
  14. ; relationship between the University and Mr. Suthers.
  15. ;
  16. ; Permission to use, modify, and distribute this software is granted subject 
  17. ; to the following restrictions and understandings:
  18. ; 1. The file header, including this notice, shall be retained, and may be
  19. ;    extended to include documentation of modifications to the software.
  20. ; 2. This material is for nonprofit educational and research purposes only.
  21. ;    Users are requested, but not required, to inform Mr. Suthers of any 
  22. ;    noteworthy uses of this software.
  23. ; 3. Mr. Suthers and the University of Massachusetts make no warrantee or
  24. ;    representation that the operation of this software will be error free,
  25. ;    and are under no obligation to provide any services.
  26. ; 4. Any user of such software agrees to indemnify and hold harmless Mr.
  27. ;    Suthers and the University of Massachusetts from all claims arising 
  28. ;    out of the use or misuse of this software, or arising out of any 
  29. ;    accident, injury, or damage whatsoever, and from all costs, counsel
  30. ;    fees, and liabilities incurred in or about any such claim, action, or
  31. ;    proceeding brought thereon.
  32. ; 5. All materials and reports developed as a consequence of the use of 
  33. ;    this software shall duly acknowledge such use, in accordance with
  34. ;    the usual standards of acknowledging credit in academic research.
  35. ;
  36. ; I wish to acknowledge the generous support of Beverly Woolf, who obtained 
  37. ; the above grants and encouraged me to pursue my own research interests in
  38. ; her lab.  This work would not have been possible without the resources and
  39. ; stimulating environment of the Computer and Information Science department.
  40. ;
  41. ; Dan Suthers 24-Jun-90 22:06:53 
  42. ;--------------------------------------------------------------------------
  43. #|
  44.  
  45. INTRODUCTION
  46.  
  47. This collection of LISP source files provides some intermediate level
  48. programming tools which may be of use to others in research and prototype
  49. development efforts. 
  50.  
  51. ---------
  52. THE FILES
  53. ---------
  54.  
  55. This collection contains the following files, which should be placed in 
  56. subdirectories as indicated:
  57.  
  58. ccl;INTERFACE:
  59.       Dialogue.lisp 
  60.       Grapher.lisp 
  61.       Grapher-Demo.lisp 
  62.       Hyper-Display.lisp
  63.       Hyper-Display-Demo.lisp
  64.  
  65. ccl;MODULES:DACTN:
  66.       DACTN-Browser.lisp
  67.       DACTN-Compile.lisp
  68.       DACTN-Demo.lisp
  69.       DACTNS.lisp
  70.  
  71. ccl;MODULES:DNET:
  72.       DNET-Analyze.lisp
  73.       DNET-Browser.lisp
  74.       DNET-Compile.lisp
  75.       DNET-Doc.text
  76.       DNET-Test.lisp
  77.       DNET.lisp
  78.  
  79. ccl;MODULES:HNET:
  80.       HNET-Browser.lisp
  81.       HNET-Compile.lisp
  82.       HNET-Printer.lisp
  83.       HNET-Test.lisp
  84.       HNET.lisp
  85.  
  86. ccl;MODULES:RULES:
  87.       Rule-Back.lisp
  88.       Rule-Browser.lisp
  89.       Rule-Build.lisp
  90.       Rule-Defs.lisp
  91.       Rule-Demo.lisp
  92.       Rule-Forward.lisp
  93.       Rules.lisp
  94.  
  95. ccl;MODULES:SM:
  96.       SM-Compile.lisp
  97.       SM-Doc.text
  98.       SM-Test.lisp
  99.       SM.lisp
  100.       SMEDIT.lisp
  101.  
  102. ccl;UTILITY:
  103.       COMPARE.lisp 
  104.       CONTROL.lisp 
  105.       DEQUEUE.lisp
  106.       MAPPINGS.lisp 
  107.       MATH.lisp 
  108.       MISC.lisp 
  109.       UTILITY.lisp
  110.  
  111. ------------------
  112. TOOL FUNCTIONALITY
  113. ------------------
  114.  
  115. DACTNS:
  116.  
  117.   Discourse ACTion Networks, which are simply a graphical means of expressing
  118.   procedural control.  Each network is defined by a set of nodes, where each 
  119.   node consists of an action and a set of arcs which are candidate ways to 
  120.   traverse out of the node.  One node is designated the start node.  DACTNs 
  121.   are represented using SM objects for Actions, Tests (on the arcs) and the
  122.   graphs that contain them.  A graphical editing interface is provided using
  123.   the Grapher package.
  124.  
  125. DNET:
  126.  
  127.   Simple discrimination net facility for storing list expressions, associating
  128.   information with those expressions, and performing pattern matching retrieval.
  129.   A discrimination net facility lets one do several things:
  130.   - 'Uniquify' list expressions under EQ by allowing one to retrive a stored
  131.     expression using an EQUAL expression as the key.
  132.   - Associate properties with list expressions (using the above capability).
  133.   - Ask whether a particular expression has been stored in a data base.
  134.   - Retrieve expressions by pattern matching using variables in either the
  135.     retrieval key or in the stored expressions.
  136.   - Change contexts efficiently by changing the discrimination net in use.
  137.   A discrimination net may be used to implement a simple data base, or to
  138.   support more sophisticated systems for deductive retrieval, forward and
  139.   backward chaining of rules, and/or truth maintenance.  The present package
  140.   attempts to be simple, general, and efficient by providing the most basic
  141.   operations efficiently implemented without frills.
  142.  
  143. HNET:
  144.  
  145.   HNET represents directed acyclic graphs, and provides efficient computation
  146.   of hierarchy relations, eg. finding the immediate or transitive predecessors
  147.   and successors of a node in the graph, and determining what the subsumption 
  148.   relation is between any two nodes.  Each node has an associated object, the
  149.   TERM.  A term's predecessors are called 'superordinates', and its successors
  150.   are 'subordinates'.  Obviously, an intended application of HNET is to encode
  151.   and test subsumption relations in term hierarchies.
  152.  
  153. INTERFACE: 
  154.  
  155.   DIALOGUE provides a uniform collection of pop-up dialogues, used heavily
  156.     by interface code in the other modules.
  157.  
  158.   GRAPHER: draws directed node-and-link graphs. Supports a variety of graph 
  159.     node and layout styles.  Nodes are mouse sensitive, and mouse actions can
  160.     be defined.  A generic grapher for SM objects (see below) is provided, 
  161.     which also serves as an example of its use.  This grapher differs from 
  162.     most in that it tries to fit the entire graph into the window.   (Most 
  163.     graphers layout the graph in as much virtual space as is needed, and then
  164.     use a scrollable window which displays only part of the graph if the graph
  165.     is too large to fit.)   My justification is that this grapher was intended
  166.     to be used with applications which are "intelligent" enough to select 
  167.     digestable quantities of information, rather than overwhelming the user 
  168.     with a huge graph.  Navigation through the graph is done by selecting 
  169.     commands on dialog menus which move from one meaningful "view" to another.
  170.  
  171.   HYPER-DISPLAY: A Hyper-text like display and browsing interface. The 
  172.     application provides a hierarchically structured representation of 
  173.     some text, and command functions.  Regions of text (possibly nested) 
  174.     have structures with pointers to application data structures associated 
  175.     with them.  Hyper-Display displays the text in a specialized Fred window.
  176.     When the user selects a range of the text with a mouse, Hyper-Display is 
  177.     able to determine the smallest structure in the hierarchy which encloses 
  178.     that region.  When the user initiates a query on this selected region of 
  179.     text, the command function is called on the structure representing the 
  180.     selected region.  For example, a command could be a request to define a
  181.     term, and the function could replace the text in the window with a 
  182.     definition, preserving a pointer to the previous hyper-structure, so
  183.     that another command can return to the original text if desired.
  184.  
  185. RULES:
  186.  
  187.   A rule-based reasoner built on the pattern-matching facilities of DNET.
  188.   Rules may be defined and edited as SM objects (see below) for convenience,
  189.   then loaded into a DNET for use.  Supports several forms of forward and
  190.   backward chaining: forward from a single datum added to a data base;
  191.   forward from all data which match in a data base; back chaining to retrieve
  192.   or determine whether an expression is true; and back chaining which also
  193.   constructs and returns the support tree which makes the expression true.
  194.  
  195. SM:
  196.  
  197.   Common Lisp Structures are extended to include support for:
  198.   - keeping track of structure types defined and of instances of them created;
  199.   - creating, destroying, and printing instances and types;
  200.   - recording and accessing information about the type and slots definitions; 
  201.   - reuse of structures of destroyed instances to reduce garbage collection;
  202.   - saving to and reloading definitions and instances from files; and 
  203.   - re-representation of existing instances when a type is redefined.
  204.   With the exception of indirect reference to structures through names, SM
  205.   attempts to be compatible with syntax of DEFSTRUCT and related functions,
  206.   and to provide at least as much functionality.  Currently only the :include
  207.   and :conc-name functionality of DEFSTRUCT are not supported.
  208.  
  209. UTILITY:
  210.   COMPARE - Alternate comparison functions (e.g. more lenient EQUAL).
  211.   CONTROL - Additional control constructs, and a RANDOM-CHOICE function.
  212.   DEQUEUE - Macros implementing Double Ended Queues.
  213.   MAPPNGS - Macros for treating association lists as abstract mappings.
  214.   MATH    - Math utilities: averaging, interpolation, coordinate conversion.
  215.   MISC    - Miscellaneous utility functions that didn't fit well elsewhere.
  216.   UTILITY - Programmer interface utilities (e.g. documentation access).
  217.  
  218. --------
  219. COMMENTS
  220. --------
  221.  
  222. Almost every MODULE uses several of the UTILITY files, and all
  223. interface files use DIALOGUE.  SM is used by quite a few of the
  224. other tools.
  225.  
  226. One can load all of the above files by evaluating the expressions at 
  227. the end of this present file. It is highly recommended that you place 
  228. the above directories on *module-search-path*.  The files SHOULD BE
  229. COMPILED.  This will greatly reduce load time, and reduce the amount
  230. of memory required.  
  231.  
  232. Documentation, when available, is in the preamble of the relevant 
  233. files.  External functions and symbols are also well documented.
  234. (SM and DNET have separate documentation files.)  Some tools have
  235. demo files, and files for compiling and testing the code.
  236.  
  237. The code is well tested for MACL 1.3.2.  Most of it will work in
  238. earlier versions of Allegro Common Lisp.  The exceptions are due to
  239. non-upward-compatible changes, e.g. window-draw-contents ->
  240. window-draw-view, which only affects interface code such as the Grapher.
  241. Non-interface files are portable across any implementation of Common 
  242. Lisp, and many have been tested on several (TI Explorer, VAX lisp, 
  243. and HP lisp).
  244.  
  245. These tools were developed by myself during the course of my Ph.D. research.  
  246. However, the enclosed are not representative of the nature of that research.
  247. My research is in Artificial Intelligence, and is concerned with explanation
  248. as a knowledge communication activity. I am examining how interactive 
  249. explanations in physical science domains make use of multiple perspectives 
  250. on a topic, including choice of knowledge type, alternate granularities and 
  251. ontologies, and the use of simplifications.  My theory attempts to account 
  252. for how an explainer balances adequacy and comprehensibility goals in making
  253. these choices, and does so in an interactive dialogue in which participants 
  254. construct and refine a mutual model of the topic.  One of my goals is to 
  255. develop the technology to support computer-based knowledge communication 
  256. systems (explainable expert systems, tutoring systems, etc.) which have some 
  257. of these capabilities.  However, you won't see any of that here.
  258.  
  259. I welcome carefully thought out written comments and bug reports, but cannot 
  260. respond to an onslaught of requests. Hence I have not provided my email 
  261. address or phone number.
  262.  
  263. -- Dan Suthers
  264.    Computer and Information Science
  265.    Lederle Graduate Research Center
  266.    University of Massachusetts
  267.    Amherst, MA 01003
  268.  
  269. |#
  270.  
  271. ;;; LOADING.  This just loads the basic code and interfaces.
  272. ;;; (Some modules also have files for demos, testing the code
  273. ;;;  after changes, compiling and testing, and documentation.
  274. ;;;  Only the demos are loaded here.)
  275. ;;; I list what modules each module requires directly; other
  276. ;;; may be required indirectly.  Comment out what you don't 
  277. ;;; want, but be careful to respect REQUIRE dependencies.
  278.  
  279. (let ((*load-verbose* t)                  ; so you can see what loads.
  280.       (*save-fred-window-positions* nil)) ; so it will fit small screens.
  281.  
  282.   ;; Utilities, all stand-alone.
  283.   (require :COMPARE "ccl;utility:compare")
  284.   (require :CONTROL "ccl;utility:control")
  285.   (require :DEQUEUE "ccl;utility:dequeue")
  286.   (require :MAPPINGS "ccl;utility:mappings")
  287.   (require :MATH "ccl;utility:math")
  288.   (require :MISC "ccl;utility:misc")
  289.   (require :UTILITY "ccl;utility:utility")
  290.  
  291.   ;; Stand-alone.
  292.   (require :DIALOGUE "ccl;interface:dialogue")
  293.  
  294.   ;; Requires Dialogue.
  295.   (require :HYPER-DISPLAY "ccl;interface:hyper-Display")
  296.   (load "ccl;interface:Hyper-Display-Demo")
  297.  
  298.   ;; Stand-alone.
  299.   (require :SM "ccl;modules:sm:sm")
  300.   ;; Requires SM, Dialogue, Misc.
  301.   (require :SMEDIT "ccl;modules:sm:smedit")
  302.   (oneof *fred-window* :filename "ccl;modules:sm:sm-doc.text")
  303.  
  304.   ;; Requires SM, SMEDIT, Dialogue, Control, Mappings, Math, and Misc.
  305.   (require :GRAPHER "ccl;interface:grapher")
  306.   (load "ccl;interface:grapher-demo")
  307.  
  308.   ;; Requires SM.
  309.   (require :HNET "ccl;modules:hnet:hnet")
  310.   ;; Requires HNET, DIALOGUE, SM, SMEDIT, Grapher, Misc.
  311.   (require :HNET-BROWSER "ccl;modules:hnet:hnet-browser")
  312.  
  313.   ;; Requires SM.
  314.   (require :DACTNS "ccl;modules:dactn:dactns")
  315.   ;; Requires DACTNS, SM, SMEDIT, DIALOGUE, GRAPHER, MISC
  316.   (require :DACTN-BROWSER "ccl;modules:dactn:dactn-browser")
  317.   (load "ccl;modules:dactn:dactn-demo")
  318.  
  319.   ;; Requires SM and Mappings.
  320.   (require :DNET "ccl;modules:dnet:dnet")
  321.   ;; Requires SM, SMEDIT, DNET, Dialogue.
  322.   (require :DNET-BROWSER "ccl;modules:dnet:dnet-browser")
  323.   (oneof *fred-window* :filename "ccl;modules:dnet:dnet-doc.text")
  324.  
  325.   ;; Requires SM, SMEDIT, DIALOGUE, DNET, DNET-Browser, GRAPHER,
  326.   ;; Misc, Mappings.  Loads all the following submodules, some
  327.   ;; of which can be omitted (see files themselves for dependencies).
  328.   (require :RULES "ccl;modules:rules:rules")
  329.   (load "ccl;modules:rules:rule-demo")
  330.   ;; (require :rule-defs "ccl;modules:rules:rule-defs")
  331.   ;; (require :rule-build "ccl;modules:rules:rule-build")
  332.   ;; (require :rule-browser "ccl;modules:rules:rule-browser")
  333.   ;; (require :rule-forward "ccl;modules:rules:rule-forward")
  334.   ;; (require :rule-back "ccl;modules:rules:rule-back")
  335.  
  336. )
  337.  
  338. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  339. ;;; The End.